package com.xuebusi.toutiao.admin.api.comment.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xuebusi.toutiao.admin.api.comment.entity.CommentEntity;
import com.xuebusi.toutiao.admin.api.comment.vo.*;
import com.xuebusi.toutiao.admin.api.common.result.ApiResult;
import com.xuebusi.toutiao.admin.api.common.result.PageInfo;
import org.springframework.http.ResponseEntity;

/**
 * 评论服务接口
 */
public interface CommentService extends IService<CommentEntity> {
    /**
     * 查询评论列表
     *
     * @param commentQuery 查询参数
     * @return
     */
    ResponseEntity<ApiResult<PageInfo<CommentEntity>>> getComments(CommentQueryPVO commentQuery);

    /**
     * 创建评论
     *
     * @param userId    用户id
     * @param createPVO 评论表单
     * @return
     */
    ResponseEntity<ApiResult<CommentCreateRVO>> createComment(Integer userId, CommentCreatePVO createPVO);

    /**
     * 对评论或回复点赞
     *
     * @param userId 用户id
     * @param target 评论id或回复id
     * @return
     */
    ResponseEntity<ApiResult<CommentLikingRVO>> liking(Integer userId, Integer target);

    /**
     * 取消对评论或回复的点赞
     *
     * @param userId 用户id
     * @param target 要取消点赞的评论id或评论回复id
     * @return
     */
    ResponseEntity cancelLiking(Integer userId, Integer target);

    /**
     * 删除评论或回复
     *
     * @param userId 用户id
     * @param target 评论或回复 id
     * @return
     */
    ResponseEntity deleteComment(Integer userId, Integer target);

    /**
     * 修改评论置顶
     *
     * @param userId 用户id
     * @param target 评论或回复id
     * @param sticky 是否置顶
     */
    ResponseEntity<ApiResult<CommentStickyRVO>> updateIsTop(Integer userId, Integer target, Boolean sticky);
}
